package com.metal.gear.certification.entity.po;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.metal.gear.common.annotation.Dict;
import com.metal.gear.common.constant.DateTimeConstant;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 * 用户表
 * </p>
 *
 * @Author scott
 * @since 2018-12-20
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("sys_user_view")
public class SysUserView  {

    @TableId(type = IdType.ASSIGN_ID)
    private String id;

    @ExcelProperty("登录账号")
    @Schema(name ="登录账号")
    private String username;

    @ExcelProperty("真实姓名")
    @Schema(name ="真实姓名")
    private String realname;

    @ExcelProperty("生日")
    @DateTimeFormat(pattern = DateTimeConstant.DATE_FORMAT_HYPHEN)
    @JsonFormat(timezone = "GMT+8", pattern = DateTimeConstant.DATE_FORMAT_HYPHEN)
    @Schema(name ="生日")
    private LocalDate birthday;

    @ExcelProperty("性别")
    @Dict(dicCode = "sex")
    @Schema(name ="性别")
    private Integer sex;

    @ExcelProperty("电子邮件")
    @Schema(name ="电子邮件")
    private String email;

    @ExcelProperty("电话")
    @Schema(name ="电话")
    private String phone;

    @ExcelProperty("状态")
    @Dict(dicCode = "user_status")
    @Schema(name ="状态(1：正常  2：冻结 ）")
    private Integer status;

    @ExcelProperty("工号")
    @Schema(name ="工号，唯一键")
    private String workNo;

    @ExcelProperty("职务")
    @Dict(dictTable ="position_code",dicText = "name",dicCode = "code")
    @Schema(name ="职务代码")
    private String positionCode;

    @ExcelProperty("职务")
    @Dict(dictTable ="position_name",dicText = "name",dicCode = "code")
    @Schema(name ="职务名称")
    private String positionName;

    @ExcelProperty("座机号")
    @Schema(name ="座机号")
    private String telephone;

    @ExcelProperty("负责部门")
    @Dict(dictTable ="responsible_depart",dicText = "depart_name",dicCode = "id")
    @Schema(name ="负责部门")
    private String responsibleDepart;

    @Schema(name ="角色Id")
    private String roleIds;

    @Schema(name ="角色代码")
    private String roleCodes;

    @ExcelProperty("角色名称")
    @Schema(name ="角色名称")
    private String roleNames;

    @Schema(name ="组织机构id")
    private String departIds;

    @ExcelProperty("组织机构代码")
    @Schema(name ="组织机构代码")
    private String departCodes;

    @ExcelProperty("组织机构名称")
    @Schema(name ="组织机构名称")
    private String departNames;

    @Schema(name ="用户创建时间")
    @DateTimeFormat(pattern = DateTimeConstant.DATETIME_FORMAT_HYPHEN)
    @JsonFormat(pattern = DateTimeConstant.DATETIME_FORMAT_HYPHEN)
    private LocalDateTime createTime;

}
